<?xml version="1.0" encoding="utf-8" ?>
<xs:schema
  xmlns="http://www.bendsoft.com/schemas/integrationservice/configuration"
  targetNamespace="http://www.bendsoft.com/schemas/integrationservice/configuration"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  attributeFormDefault="unqualified"
  elementFormDefault="qualified">

  <!-- === Configuration === -->

  <xs:element name="Configuration">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="Task" maxOccurs="unbounded" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <!-- === Task === -->

  <xs:element name="Task">
    <xs:complexType>
      <xs:all>
        <xs:element name="Name" type="xs:string" minOccurs="1" />
        <xs:element name="Enabled" type="xs:boolean" minOccurs="1" />
        <xs:element ref="DateMask" minOccurs="1" />
        <xs:element ref="Command" minOccurs = "1" />
        <xs:element ref="Plugin" minOccurs = "1" />
      </xs:all>
    </xs:complexType>
  </xs:element>

  <!-- === DateMask === -->

  <xs:element name="DateMask">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:string">
          <xs:attribute name="StartDate" type="xs:dateTime" use="optional">
          </xs:attribute>
          <xs:attribute name="EndDate" type="xs:dateTime" use="optional">
          </xs:attribute>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

  <!-- === Command === -->

  <xs:element name="Command">
    <xs:complexType>
      <xs:all>
        <xs:element name="ConnectionString" type="xs:string" minOccurs="1" />
        <xs:element name="ListName" type="xs:string" minOccurs="0" />
        <xs:element name="ViewName" type="xs:string" minOccurs="0" />
        <xs:element name="SqlCommand" type="xs:string" minOccurs="0" />
        <xs:element name="IncludeAttachments" type="xs:boolean" minOccurs="0" />
      </xs:all>
    </xs:complexType>
  </xs:element>

  <!-- === Plugin === -->

  <xs:element name="Plugin">
    <xs:complexType>
      <xs:all>
        <xs:element name="TypeName" type="xs:string" minOccurs="1" />
        <xs:element name="Parameters" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element ref="Parameter" minOccurs="1" maxOccurs="unbounded" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:all>
    </xs:complexType>
  </xs:element>

  <!-- === Parameter === -->

  <xs:element name="Parameter">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:string">
          <xs:attribute name="Name" type="xs:string" use="required">
          </xs:attribute>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

</xs:schema>